﻿using System;
using System.Collections.Generic;
using System.IO;
using System.IO.Compression;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace LinqPadCrack
{
    public class Helper
    {
        public static byte[] DecompressResource(string fileName)
        {
            byte[] array = new byte[65536];
            var r = File.OpenRead(fileName);
            var ms = new MemoryStream();
            using (var deflateStream = new DeflateStream(r, CompressionMode.Decompress))
            {
                for (; ; )
                {
                    int num = deflateStream.Read(array, 0, array.Length);
                    bool flag2 = num == 0;
                    if (flag2)
                    {
                        break;
                    }
                    ms.Write(array, 0, num);
                }
            }
            return ms.ToArray();
        }
    }
}
